package com.timebank.score.controller;

import com.timebank.common.core.web.pojo.AjaxResult;
import com.timebank.common.security.annotation.RequiresLogin;
import com.timebank.score.pojo.dto.LotteryDTO;
import com.timebank.score.service.LotteryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 积分抽奖 控制层
 * @author shiliuyinzhen
 */
@RestController
@RequestMapping("/lottery")
@Api(tags = "积分抽奖相关接口")
public class LotteryController {

    @Resource
    private LotteryService lotteryService;

    /**
     * 开始抽奖
     * @return
     */
    @RequiresLogin
    @PostMapping("/begin")
    @ApiOperation("开始抽奖")
    public AjaxResult begin(@RequestBody LotteryDTO lotteryDTO){
        return lotteryService.begin(lotteryDTO);
    }


}
